package org.apache.commons.graph.view

import com.gitee.wsl.func.consumer.Consumer
import org.apache.commons.graph.bean.Edge


interface IInwardEdgeVisitor<V, E : Edge<V>> {
    fun getInwardEdges(source: V): List<E>

    fun forEachInwardEdge(source: V, action: Consumer<E>) {
        val edges = getInwardEdges(source)
        for (edge in edges) {
            action.accept(edge)
        }
    }
}